#pragma once

#include "FixApi.h"
#include "fiddef.h"

#include "fmt/format.h"
#include "fmt/color.h"
#include "spdlog/spdlog.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/rotating_file_sink.h"

#include <random>
#include "CommInc.h"

extern std::shared_ptr<spdlog::logger> logger;

inline string Geterrmsg(HANDLE_SESSION sess)
{
	char errs[256]{};
	int errlen = sizeof(errs);
	Fix_GetErrMsg(sess, errs, errlen);
	return errs;
}

bool PushCallBackFunc(HANDLE_CONN conn, HANDLE_SESSION sess, int64_t nSubs, void *pData);
bool TradePushCallBackFunc(HANDLE_CONN conn, HANDLE_SESSION sess, int64_t nSubs, void *pData);

void SubPushOrder(HANDLE_SESSION sess, const char *khh, const char *token);

void SubPushTrade(HANDLE_SESSION sess, const char *khh, const char *token);